﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PraviceFunkcionalnosti.aspx.cs" Inherits="Sio.Mdm.Web.Instalacija.Varnost.PraviceFunkcionalnosti" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>SIO - MDM :: Instalacija : Pravice-Funkcionalnosti</title>
</head>
<body>
    <form id="VlogePravice" runat="server">
    <ext:ResourceManager ID="ResourceManager1" runat="server" />
    <ext:Viewport ID="Viewport1" runat="server" Layout="Fit">
        <Content>
            <ext:BorderLayout ID="BorderLayout1" runat="server">
                <North Collapsible="false" MinHeight="300" Split="true">
                    <sio:GridPanel ID="GridSplosniSeznam" runat="server" StripeRows="true" TrackMouseOver="true"
                        Height="300">
                        <Plugins>
                            <ext:GridFilters ID="GridFilters1" runat="server">
                                <Filters>
                                    <ext:NumericFilter DataIndex="PravicaId" />
                                    <ext:StringFilter DataIndex="Naziv" />
                                </Filters>
                            </ext:GridFilters>
                        </Plugins>
                        <Store>
                            <ext:Store ID="StoreSplosniSeznam" runat="server">
                                <SortInfo Field="Naziv" />
                                <Reader>
                                    <ext:JsonReader IDProperty="PravicaId">
                                        <Fields>
                                            <ext:RecordField Name="PravicaId" Type="Int" />
                                            <ext:RecordField Name="Naziv" Type="String" />
                                        </Fields>
                                    </ext:JsonReader>
                                </Reader>
                            </ext:Store>
                        </Store>
                        <ColumnModel ID="ColumnModel1" runat="server">
                            <Columns>
                                <ext:RowNumbererColumn />
                                <ext:Column ColumnID="PravicaId" Hidden="true" Hideable="false" DataIndex="PravicaId">
                                </ext:Column>
                                <ext:Column ColumnID="Naziv" Header="Naziv pravice" DataIndex="Naziv" Width="150">
                                </ext:Column>
                            </Columns>
                        </ColumnModel>
                        <SelectionModel>
                            <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" SingleSelect="true">
                                <Listeners>
                                    <RowSelect Handler="{#{StoreDodeljeno}.reload();}" Buffer="250" />
                                </Listeners>
                            </ext:RowSelectionModel>
                        </SelectionModel>
                    </sio:GridPanel>
                </North>
                <West Split="true">
                    <sio:GridPanel ID="GridDodeljeno" Title="Dodeljene funkcionalnosti" Width="300" 
                        EnableDragDrop="true" runat="server" StripeRows="true" TrackMouseOver="true">
                        <Plugins>
                            <ext:GridFilters ID="GridFiltersDodeljeno" runat="server">
                                <Filters>
                                    <ext:NumericFilter DataIndex="FunkcionalnostId" />
                                    <ext:StringFilter DataIndex="Naziv" />
                                </Filters>
                            </ext:GridFilters>
                        </Plugins>
                        <Store>
                            <ext:Store ID="StoreDodeljeno" runat="server" OnRefreshData="GridDodeljenoRefresh">
                                <SortInfo Field="Naziv" />
                                <Reader>
                                    <ext:JsonReader IDProperty="FunkcionalnostId">
                                        <Fields>
                                            <ext:RecordField Name="FunkcionalnostId" Type="Int" />
                                            <ext:RecordField Name="Naziv" Type="String" />
                                        </Fields>
                                    </ext:JsonReader>
                                </Reader>
                                <BaseParams>
                                    <ext:Parameter Name="PravicaId" Value="#{GridSplosniSeznam}.getSelectionModel().hasSelection() ? #{GridSplosniSeznam}.getSelectionModel().getSelected().id : -1"
                                        Mode="Raw" />
                                </BaseParams>
                            </ext:Store>
                        </Store>
                        <ColumnModel ID="ColumnModel2" runat="server">
                            <Columns>
                                <ext:RowNumbererColumn />
                                <ext:Column ColumnID="FunkcionalnostId" Hidden="true" Hideable="false" DataIndex="FunkcionalnostId">
                                </ext:Column>
                                <ext:Column ColumnID="Naziv" Header="Naziv funkcionalnosti" DataIndex="Naziv" Width="150">
                                </ext:Column>
                            </Columns>
                        </ColumnModel>
                        <SelectionModel>
                            <ext:CheckboxSelectionModel ID="CheckboxSelectionModel2" runat="server" />
                        </SelectionModel>
                        <TopBar>
                            <ext:Toolbar ID="Toolbar2" runat="server" Width="500">
                                <Items>
                                    <ext:ToolbarFill />
                                    <sio:Button ID="Button1" runat="server" Text="Odstrani" Icon="ArrowRight">
                                        <DirectEvents>
                                            <Click OnEvent="OdstraniFunkcionalnosti" After="#{StoreDodeljeno}.reload();">
                                                <Confirmation ConfirmRequest="true" Message="Odstranim izbrane funkcionalnosti?" />
                                                <ExtraParams>
                                                    <ext:Parameter Name="selected" Mode="Raw" Value="Ext.encode(#{GridDodeljeno}.getRowsValues({selectedOnly:true}))" />
                                                    <ext:Parameter Name="PravicaId" Value="#{GridSplosniSeznam}.getSelectionModel().hasSelection() ? #{GridSplosniSeznam}.getSelectionModel().getSelected().id : -1"
                                                        Mode="Raw" />
                                                </ExtraParams>
                                            </Click>
                                        </DirectEvents>
                                    </sio:Button>
                                </Items>
                            </ext:Toolbar>
                        </TopBar>
                    </sio:GridPanel>
                </West>
                <Center Split="true">
                    <sio:GridPanel ID="GridNeDodeljeno" Title="Nedodeljene funkcionalnosti" runat="server" StripeRows="true"
                        Layout="Fit" Height="300">
                        <Plugins>
                            <ext:GridFilters ID="GridFilters2" runat="server">
                                <Filters>
                                    <ext:NumericFilter DataIndex="FunkcionalnostId" />
                                    <ext:StringFilter DataIndex="Naziv" />
                                </Filters>
                            </ext:GridFilters>
                        </Plugins>
                        <Store>
                            <ext:Store ID="StoreGridNeDodeljeno" runat="server">
                                <SortInfo Field="Naziv" />
                                <Reader>
                                    <ext:JsonReader IDProperty="FunkcionalnostId">
                                        <Fields>
                                            <ext:RecordField Name="FunkcionalnostId" Type="Int" />
                                            <ext:RecordField Name="Naziv" Type="String" />
                                        </Fields>
                                    </ext:JsonReader>
                                </Reader>
                            </ext:Store>
                        </Store>
                        <ColumnModel ID="ColumnModel3" runat="server">
                            <Columns>
                                <ext:RowNumbererColumn />
                                <ext:Column ColumnID="FunkcionalnostId" Hidden="true" Hideable="false" DataIndex="FunkcionalnostId">
                                </ext:Column>
                                <ext:Column ColumnID="Naziv" Header="Naziv funkcionalnosti" DataIndex="Naziv" Width="150">
                                </ext:Column>
                            </Columns>
                        </ColumnModel>
                        <SelectionModel>
                            <ext:CheckboxSelectionModel ID="CheckboxSelectionModel1" runat="server" />
                        </SelectionModel>
                        <TopBar>
                            <ext:Toolbar ID="Toolbar1" runat="server" Width="500">
                                <Items>
                                    <sio:Button ID="Button3" runat="server" Text="Dodaj" Icon="ArrowLeft">
                                        <DirectEvents>
                                            <Click OnEvent="DodajFunkcionalnosti" After="#{StoreGridNeDodeljeno}.reload(); #{StoreDodeljeno}.reload();">
                                                <Confirmation ConfirmRequest="true" Message="Dodam izbrane funkcionalnosti?" />
                                                <ExtraParams>
                                                    <ext:Parameter Name="selected" Mode="Raw" Value="Ext.encode(#{GridNeDodeljeno}.getRowsValues({selectedOnly:true}))" />
                                                    <ext:Parameter Name="PravicaId" Value="#{GridSplosniSeznam}.getSelectionModel().hasSelection() ? #{GridSplosniSeznam}.getSelectionModel().getSelected().id : -1"
                                                        Mode="Raw" />
                                                </ExtraParams>
                                            </Click>
                                        </DirectEvents>
                                    </sio:Button>
                                </Items>
                            </ext:Toolbar>
                        </TopBar>
                    </sio:GridPanel>
                </Center>
            </ext:BorderLayout>
        </Content>
    </ext:Viewport>
    </form>
</body>
</html>

